#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

namespace TGN
{
	/// <summary> 
	/// Summary for AnimationProperties
	///
	/// WARNING: If you change the name of this class, you will need to change the 
	///          'Resource File Name' property for the managed resource compiler tool 
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>
	public __gc class AnimationProperties : public System::Windows::Forms::Form
	{
	public: 

		AnimationProperties(void)
		{
			InitializeComponent();
			accepted = false;
		}
        
	protected: 
		void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}
	private: System::Windows::Forms::Label *  label1;
	private: System::Windows::Forms::Label *  label2;
	private: System::Windows::Forms::NumericUpDown *  IDRange;
	private: System::Windows::Forms::NumericUpDown *  NextIDRange;
	private: System::Windows::Forms::Button *  APOK;
	private: System::Windows::Forms::Button *  APCancel;

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container* components;
	private: System::Windows::Forms::Label *  label3;
	private: System::Windows::Forms::Label *  label4;
	private: System::Windows::Forms::NumericUpDown *  bboxWidth;
	private: System::Windows::Forms::NumericUpDown *  bboxHeight;
	private: System::Windows::Forms::Label *  label5;
	private: System::Windows::Forms::TextBox *  aniName;
			 bool accepted;

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			System::Resources::ResourceManager *  resources = new System::Resources::ResourceManager(__typeof(TGN::AnimationProperties));
			this->label1 = new System::Windows::Forms::Label();
			this->label2 = new System::Windows::Forms::Label();
			this->IDRange = new System::Windows::Forms::NumericUpDown();
			this->NextIDRange = new System::Windows::Forms::NumericUpDown();
			this->APOK = new System::Windows::Forms::Button();
			this->APCancel = new System::Windows::Forms::Button();
			this->label3 = new System::Windows::Forms::Label();
			this->label4 = new System::Windows::Forms::Label();
			this->bboxWidth = new System::Windows::Forms::NumericUpDown();
			this->bboxHeight = new System::Windows::Forms::NumericUpDown();
			this->label5 = new System::Windows::Forms::Label();
			this->aniName = new System::Windows::Forms::TextBox();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->IDRange))->BeginInit();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->NextIDRange))->BeginInit();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->bboxWidth))->BeginInit();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->bboxHeight))->BeginInit();
			this->SuspendLayout();
			// 
			// label1
			// 
			this->label1->Location = System::Drawing::Point(8, 46);
			this->label1->Name = S"label1";
			this->label1->Size = System::Drawing::Size(136, 16);
			this->label1->TabIndex = 0;
			this->label1->Text = S"ID Number";
			// 
			// label2
			// 
			this->label2->Location = System::Drawing::Point(8, 76);
			this->label2->Name = S"label2";
			this->label2->Size = System::Drawing::Size(136, 16);
			this->label2->TabIndex = 1;
			this->label2->Text = S"Next ID Number";
			// 
			// IDRange
			// 
			this->IDRange->Location = System::Drawing::Point(152, 46);
			this->IDRange->Name = S"IDRange";
			this->IDRange->Size = System::Drawing::Size(64, 22);
			this->IDRange->TabIndex = 2;
			// 
			// NextIDRange
			// 
			this->NextIDRange->Location = System::Drawing::Point(152, 76);
			this->NextIDRange->Name = S"NextIDRange";
			this->NextIDRange->Size = System::Drawing::Size(64, 22);
			this->NextIDRange->TabIndex = 3;
			// 
			// APOK
			// 
			this->APOK->Location = System::Drawing::Point(24, 168);
			this->APOK->Name = S"APOK";
			this->APOK->Size = System::Drawing::Size(80, 24);
			this->APOK->TabIndex = 4;
			this->APOK->Text = S"OK";
			this->APOK->Click += new System::EventHandler(this, APOK_Click);
			// 
			// APCancel
			// 
			this->APCancel->DialogResult = System::Windows::Forms::DialogResult::Cancel;
			this->APCancel->Location = System::Drawing::Point(128, 168);
			this->APCancel->Name = S"APCancel";
			this->APCancel->Size = System::Drawing::Size(88, 24);
			this->APCancel->TabIndex = 5;
			this->APCancel->Text = S"Cancel";
			this->APCancel->Click += new System::EventHandler(this, APCancel_Click);
			// 
			// label3
			// 
			this->label3->Location = System::Drawing::Point(8, 106);
			this->label3->Name = S"label3";
			this->label3->Size = System::Drawing::Size(136, 16);
			this->label3->TabIndex = 6;
			this->label3->Text = S"Bounding Box Width";
			// 
			// label4
			// 
			this->label4->Location = System::Drawing::Point(8, 136);
			this->label4->Name = S"label4";
			this->label4->Size = System::Drawing::Size(136, 16);
			this->label4->TabIndex = 7;
			this->label4->Text = S"Bounding Box Height";
			// 
			// bboxWidth
			// 
			this->bboxWidth->Location = System::Drawing::Point(152, 106);
			this->bboxWidth->Name = S"bboxWidth";
			this->bboxWidth->Size = System::Drawing::Size(64, 22);
			this->bboxWidth->TabIndex = 8;
			// 
			// bboxHeight
			// 
			this->bboxHeight->Location = System::Drawing::Point(152, 136);
			this->bboxHeight->Name = S"bboxHeight";
			this->bboxHeight->Size = System::Drawing::Size(64, 22);
			this->bboxHeight->TabIndex = 9;
			// 
			// label5
			// 
			this->label5->Location = System::Drawing::Point(8, 16);
			this->label5->Name = S"label5";
			this->label5->Size = System::Drawing::Size(48, 16);
			this->label5->TabIndex = 10;
			this->label5->Text = S"Name";
			// 
			// aniName
			// 
			this->aniName->Location = System::Drawing::Point(56, 16);
			this->aniName->Name = S"aniName";
			this->aniName->Size = System::Drawing::Size(160, 22);
			this->aniName->TabIndex = 11;
			this->aniName->Text = S"";
			// 
			// AnimationProperties
			// 
			this->AcceptButton = this->APOK;
			this->AutoScaleBaseSize = System::Drawing::Size(6, 15);
			this->CancelButton = this->APCancel;
			this->ClientSize = System::Drawing::Size(242, 202);
			this->Controls->Add(this->aniName);
			this->Controls->Add(this->label5);
			this->Controls->Add(this->bboxHeight);
			this->Controls->Add(this->bboxWidth);
			this->Controls->Add(this->label4);
			this->Controls->Add(this->label3);
			this->Controls->Add(this->APCancel);
			this->Controls->Add(this->APOK);
			this->Controls->Add(this->NextIDRange);
			this->Controls->Add(this->IDRange);
			this->Controls->Add(this->label2);
			this->Controls->Add(this->label1);
			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
			this->Icon = (__try_cast<System::Drawing::Icon *  >(resources->GetObject(S"$this.Icon")));
			this->MaximizeBox = false;
			this->MinimizeBox = false;
			this->Name = S"AnimationProperties";
			this->Text = S"Set Animation Properties";
			this->TopMost = true;
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->IDRange))->EndInit();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->NextIDRange))->EndInit();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->bboxWidth))->EndInit();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->bboxHeight))->EndInit();
			this->ResumeLayout(false);

		}		
	private: System::Void APOK_Click(System::Object *  sender, System::EventArgs *  e)
			 {
				 if(aniName->Text->Equals(""))
				 {
					 MessageBox::Show("Please enter a name for this animation");
					 return;
				 }

				 if(aniName->Text->Length >= 9)
					aniName->Text = aniName->Text->Substring(0, 8);

				accepted = true;
				this->Hide();
			 }

	public: bool Execute(int range, int next, int bboxW, int bboxH, char *name)
	 {
		 IDRange->Value = range;
		 NextIDRange->Value = next;
		 bboxWidth->Value = bboxW;
		 bboxHeight->Value = bboxH;
		 aniName->Text = name;

		 this->ShowDialog();
		 return accepted;
	 }

private: System::Void APCancel_Click(System::Object *  sender, System::EventArgs *  e)
		 {
			 IDRange->Value = 0;
			 NextIDRange->Value = 0;

			 accepted = false;
			 this->Hide();
		 }

public: int GetID() 
		 {
			 return Decimal::ToInt32(IDRange->Value);
		 }

public: int GetNextID() 
		 { 
			 return Decimal::ToInt32(NextIDRange->Value);
		 }
public: int GetBBoxWidth()
		{
			return Decimal::ToInt32(bboxWidth->Value);
		}
public: int GetBBoxHeight()
		{
			return Decimal::ToInt32(bboxHeight->Value);
		}

public: String *GetName()
		{
			return aniName->Text;
		}

};

}